<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <button onclick="login()">微信扫码登录</button>
    <img id="qrPic">
</body>

<script src="./js/axios.min.js"></script>

<script>
    function login() {
        axios.get("http://localhost:9000/wxLogin", { params: null, responseType: 'blob' })
            .then(function (response) { //success 是自定义响应的参数名
                //返回成功的响应
                const url = URL.createObjectURL(response.data);
                document.querySelector("#qrPic").setAttribute("src", url);
            });
    }
</script>

</html>